<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use shopend\assets\ShopAsset;

StaticService::includeAppJsStatic(GlobalUrlService::buildShopStaticUrl('/backend/active/info.js'),ShopAsset::class);
StaticService::includeAppCssStatic(GlobalUrlService::buildShopStaticUrl('/css/active/info.css'),ShopAsset::class);
?>

<div class="layui-card">
  <div class="layui-card-header">活动详情</div>
  <div class="layui-card-body">
    <div class="active_info">
      <div class="layui-field-box">
        <ul>
          <li>
            <span class="layui-inline">活动名称</span>
            <span class="layui-inline"><?= $active['active_name'] ?></span>
          </li>
          <li>
            <span class="layui-inline">活动时间</span>
            <span class="layui-inline"><?=date('Y-m-d', $active['begin_time']) ?> -- <?=date('Y-m-d', $active['end_time']) ?></span>
          </li>
          <li>
            <span class="layui-inline">活动人数</span>
            <span class="layui-inline"><?= $active['active_num'] ?></span>
          </li>
        </ul>
        <table class="layui-table">
          <thead>
            <tr>
              <?php foreach ($active_attr['thead'] as $th):?>
                <th><?= $th?></th>
              <?php endforeach;?>
              <th>图片</th>
              <th>原价</th>
              <th>拼团价</th>
              <th>拼团库存</th>
              <th>销量</th>
            </tr>
          </thead>
          <tbody id="qrinfo">
            <?php foreach ($active_attr['tbody'] as $key=>$v):?>
              <tr>
                <?php foreach ($v['val'] as $nv):?>
                  <td><?= $nv['value'] ?></td>
                <?php endforeach;?>
                <td><img class="showPicc" src="<?php echo GlobalUrlService::buildCdnUrl($v['attr_img'])?>"></td>
                <td><?= $v['original_price'] ?></td>
                <td><?= $v['collage_price'] ?></td>
                <td><?= $v['inventory']?></td>
                <td><?= 0 ?></td>
              </tr>
            <?php endforeach;?>
          </tbody>
        </table>
      </div>
      <a class="layui-btn layui-btn-primary" href="<?= GlobalUrlService::buildShopUrl('active/index')?>">返回</a>
    </div>
  </div>
</div>